home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
FromTheMag
/
JW FLV MEDIA PLAYER 4.2
/
mediaplayer.exe
/
player.swf
/
scripts
/
com
/
jeroenwijering
/
utils
/
Draw.as
< prev
next >
Wrap
Text File
|
2008-11-04
|
3KB
|
81 lines
package com.jeroenwijering.utils
{
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFormat;
public class Draw
{
public function Draw()
{
super();
}
public static function rect(param1:Sprite, param2:String, param3:Number, param4:Number, param5:Number = 0, param6:Number = 0, param7:Number = 1) : Sprite
{
var _loc8_:Sprite = null;
(_loc8_ = new Sprite()).x = param5;
_loc8_.y = param6;
_loc8_.graphics.beginFill(uint(param2),param7);
_loc8_.graphics.drawRect(0,0,param3,param4);
param1.addChild(_loc8_);
return _loc8_;
}
public static function clone(param1:MovieClip, param2:Boolean = false) : MovieClip
{
var _loc3_:Class = null;
var _loc4_:MovieClip = null;
var _loc5_:* = undefined;
_loc3_ = Object(param1).constructor;
(_loc4_ = new _loc3_()).transform = param1.transform;
_loc4_.filters = param1.filters;
_loc4_.cacheAsBitmap = param1.cacheAsBitmap;
_loc4_.opaqueBackground = param1.opaqueBackground;
if(param2 == true)
{
_loc5_ = param1.parent.getChildIndex(param1);
param1.parent.addChildAt(_loc4_,_loc5_ + 1);
}
return _loc4_;
}
public static function clear(param1:Sprite) : void
{
var _loc2_:Number = NaN;
var _loc3_:Number = NaN;
_loc2_ = param1.numChildren;
_loc3_ = 0;
while(_loc3_ < _loc2_)
{
param1.removeChildAt(0);
_loc3_++;
}
param1.scaleX = param1.scaleY = 1;
}
public static function text(param1:Sprite, param2:String, param3:Number, param4:Number, param5:String, param6:String = "left", param7:Number = 12, param8:String = "Arial") : TextField
{
var _loc9_:TextField = null;
var _loc10_:TextFormat = null;
_loc9_ = new TextField();
_loc10_ = new TextFormat();
_loc9_.autoSize = param6;
_loc9_.selectable = false;
_loc10_.font = param8;
_loc10_.color = param2;
_loc10_.size = param7;
_loc10_.underline = false;
_loc9_.defaultTextFormat = _loc10_;
_loc9_.x = param3;
_loc9_.y = param4;
_loc9_.text = param5;
param1.addChild(_loc9_);
return _loc9_;
}
}
}